<!-- page heading start-->
<div class="page-heading">
    <h3>
        条件列表
    </h3>

</div>
<!-- page heading end-->
<div class="row">
    <div class="col-sm-12">
        <section class="panel">
            <header class="panel-heading">
                <a class="btn btn-default" href="<?php echo '/User/Tool/condUpdate?specId=' . I('get.specId', '', '');?>">增加</a>
                <a class="btn btn-primary" href="<?php echo '/User/Tool/spec?schId=' . I('get.schId', '', '');?>">返回专业</a>
            </header>
            <div class="panel-body">
                <table class="table table-hover general-table table-bordered">
                    <thead>
                    <tr>
                        <th width="5%">A+</th>
                        <th width="5%">B+</th>
                        <th width="5%">C+</th>
                        <th width="5%">D+</th>
                        <th width="5%">A+B</th>
                        <th width="5%">总分</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php foreach($list as $val){?>
                    <tr>
                        <td>
                            <span style="word-break:break-all;word-wrap:break-word">
                                <?php echo $val['ap'];?>
                            </span>
                        </td>
                        <td>
                            <span style="word-break:break-all;word-wrap:break-word">
                                <?php echo $val['bp'];?>
                            </span>
                        </td>
                        <td>
                            <span style="word-break:break-all;word-wrap:break-word">
                                <?php echo $val['cp'];?>
                            </span>
                        </td>
                        <td>
                            <span style="word-break:break-all;word-wrap:break-word">
                                <?php echo $val['dp'];?>
                            </span>
                        </td>
                        <td>
                            <span style="word-break:break-all;word-wrap:break-word">
                                <?php echo $val['abp'];?>
                            </span>
                        </td>
                        <td>
                            <span style="word-break:break-all;word-wrap:break-word">
                                <?php echo $val['score'];?>
                            </span>
                        </td>

                        <td>
                            <div>
                                <a class="btn btn-success"
                                   href="<?php echo '/User/Tool/condUpdate?type=update&schId=' .
                                   I('get.schId', '', '') . '&specId=' . I('get.specId', '', '') . '&condId=' . $val['cond_id'];?>">编辑</a>
                                <a class="btn btn-danger" href="#"
                                   onclick="<?php echo 'return delete_data(' . $val['cond_id'] .')';?>">删除</a>
                            </div>
                        </td>
                    </tr>
                    <?php }?>

                    </tbody>
                </table>
                <div class="pages">
                    {$page}
                </div>
            </div>
        </section>
    </div>
</div>
<script>
    function delete_data(id){
        $.ajax({
            data:{condId:id},
            dataType:'json',
            url:'/User/Tool/condDelete',
            type:'get',
            success:function(res){
                window.location.reload();
            }
        });
        return false;
    }
</script>